package com.yihu.cms.service;

import java.io.IOException;

import com.yihu.beans.ResultVO;
import com.yihu.beans.user.Group;
import com.yihu.beans.user.GroupQuery;
import com.yihu.beans.user.PermitQuery;
import com.yihu.beans.user.PermitResourceRef;
import com.yihu.beans.user.Priviledge;
import com.yihu.beans.user.UserGroupRef;
import com.yihu.dataService.hessian.mongodb.interfaceService.PriviledgeHService;
import com.yihu.dataService.hessian.mongodb.interfaceService.UserGroupHService;
import com.yihu.dataService.hessian.resource.ResourceMongoDBManager;

public class PriviledgeService {

	PriviledgeHService priviledgeService = null;
	public PriviledgeService(){
		try {
			priviledgeService= (PriviledgeHService)ResourceMongoDBManager.getSingleton().getBeans("priviledgeServiceHSC");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public ResultVO addPermit(Priviledge permit){
		return priviledgeService.addPermit(permit);
	}
	public ResultVO deletePermit(long id){
		return priviledgeService.deletePermit(id);
	}
	public ResultVO updatePermit(Priviledge permit){
		return priviledgeService.updatePermit(permit);
	}
	public Priviledge getPermit(long id){
		return priviledgeService.getPermit(id);
	}
	public String getPermitByPage(PermitQuery query){
		return priviledgeService.getPermitByPage(query);
	}
	public Priviledge getRolesByPermitId(PermitQuery query){
		return priviledgeService.getRolesByPermitId(query);
	}
	public ResultVO addResourceToPriviledge(PermitResourceRef prRef){
		return priviledgeService.addResourceToPriviledge(prRef);
	}
	public ResultVO deleteResourceFromPriviledge(PermitResourceRef prRef){
		return priviledgeService.deleteResourceFromPriviledge(prRef);
	}
	
	public Object getResourcesByPermit(PermitQuery query){
		return priviledgeService.getResourcesByPermit(query);
	}
	public ResultVO assignResources(PermitResourceRef prRef){
		return priviledgeService.assignResources(prRef);
	}
	
	public Object getPermitsByParentId(PermitQuery query){
		return priviledgeService.getPermitsByParentId(query);
	}
	
	public Object getParentPermits(PermitQuery query){
		return priviledgeService.getParentPermits(query);
	}
	
	public Object getChildrensByParentId(long id){
		return priviledgeService.getChildrensByParentId(id);
	}
	
}
